﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UPNP.IO.ValueConverters
{
    internal sealed class DeviceUuidConverter : IDeviceValueConverter
    {
        public Type ManagedType
        {
            get { return typeof(Guid); }
        }

        public object FromDevice(string value)
        {
            return new Guid(value);
        }

        public string ToDevice(object value)
        {
            if (value is Guid)
            {
                return ((Guid)value).ToString("N");
            }

            return Convert.ToString(value);
        }
    }
}
